// Purpose:   Demonstrates the use of constructor in a C++ class

#include <iostream>
#include "selector.h"
using namespace std;

#if select==2

// Class to represent a box
class Box
{
public:
	double length;
	double breadth;
	double height;

	// Constructor
	Box(double lengthValue, double breadthValue, double heightValue)
	{
		cout << "Box constructor called" << endl;
		length = lengthValue;
		breadth = breadthValue;
		height = heightValue;
	}

	// Function to calculate the volume of a box
	double volume()
	{
		return length * breadth * height;
	}
};

void main()
{
	Box box(1, 2, 3);
	cout << "length, breadth, height is: "
		<< box.length << " "
		<< box.breadth << " "
		<< box.height << " "
		<< "\n" << "volume is: "
		<< box.volume() << endl;

	system("pause");
}
#endif
